package send_file;

import plugin.PluginInterface;

/**
 *
 * @author zem
 */
public class Main implements PluginInterface {

    private static String[][] groups; // [x][y]  x - group number y - parameter(0 - user, 1 - adress, 2 - port);
    private static String[] files; // files to transfer;
    private static boolean stop; //stop flag
    private static boolean crashed; //crash flag
    private static String crash_error; //crash error

    public boolean hasParameters() {
        return true;
    }

    public String[] ParameterNames() {
        String[] mes = {"file"};
        return mes;
    }

    public String[] GroupNames() {
        String[] mes = {"socket"};
        return mes;
    }

    public String[][] GroupParameterNames() {
        String[][] mes = new String[1][3];
        mes[0][0] = "user";
        mes[0][1] = "adress";
        mes[0][2] = "port";
        return mes;
    }

    public String About() {
        return "send_file is used to send files. Server side must have plugin receive_file";
    }

    public boolean Crashed() {
        return crashed;
    }

    public String CrashError() {
        return crash_error;
    }

    public void Start() {
        stop = false;
        crashed = false;

    }

    public void Stop() {
        stop = true;
    }

    public void InputParameters(String[][] Plugin_String_parameter, String[][][][] Plugin_Group_String_parameter) {
        files = new String[Plugin_String_parameter[0].length];
        for (int i = 0; i < Plugin_String_parameter[0].length; i++) {
            files[i] = Plugin_String_parameter[0][i];
        }
        groups = new String[Plugin_Group_String_parameter[0].length][3];
        for (int i = 0; i < Plugin_Group_String_parameter[0].length; i++) {
            groups[i][0] = Plugin_Group_String_parameter[0][i][0][0];
            groups[i][1] = Plugin_Group_String_parameter[0][i][1][0];
            groups[i][2] = Plugin_Group_String_parameter[0][i][2][0];
        }
    }

    
}
